<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div {
            height: 200px;
            width: 200px;
            background: gold;
            /*上下外边距为0，左右自适应*/
             margin: 0 auto;
        }
    </style>
</head>
<body>
<div></div>
</body>
</html>